package com.example.staticProxy.Proxy;

import com.example.service.UserService;

public class ProxyByInterface implements UserService {
    private UserService target;

    public ProxyByInterface(UserService target) {
        this.target = target;
    }
    public static UserService getProxy(UserService target) {
        return new ProxyByInterface(target);
    }

    @Override
    public void addOne() {
        System.out.println("addOne 执行前");
        target.addOne();
        System.out.println("addOne 执行后");
    }

    @Override
    public void deleteOne() {
        System.out.println("deleteOne 执行前");
        target.deleteOne();
        System.out.println("deleteOne 执行后");
    }
}
